package com.kira.scaffoldmvc.Mapper.ds1;

import com.kira.scaffoldmvc.POJO.Dictionary;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DictionaryMapper {

    @Select("select  * from dictionary")
    List<Dictionary> selectAll();


    @Insert("<script>" +
            "INSERT INTO dictionary (code, code_name) VALUES " +
            "<foreach collection='list' item='item' separator=','>" +
            "(#{item.code}, #{item.codeName})" +
            "</foreach>" +
            "</script>")
    int batchInsert(@Param("list") List<Dictionary> list);

}
